<template>
  <div class="app-container">
    <!-- 查询 -->
    <tl-list-search ref="search" :query-param="queryParam" @search="doQuery" v-if="isHeaderDisplay"></tl-list-search>
    <!-- 工具栏 -->
    <tl-list-toolbar ref="toolbar" @add="openAddDialog('editForm')" @exportExcel="doExportExcel" @deleteBatch="doDeleteBatch" @refresh="doRefresh" @columnCustomize="doColumnCustomize" @displaySearch="doDisplaySearch" :isDisplayDeleteBatch="selectedRowKeys.length > 0"> </tl-list-toolbar>
    <div>
      <!-- 列表选择 -->
      <div class="table-alert-div" ref="selector">
        <el-alert type="success" :closable="false" class="tl-table-alert-info" effect="light">
          <template slot="title">
            已选择&nbsp;<a class="tl-table-alert-info-a1">{{ selectedRowKeys.length }}</a>项&nbsp;&nbsp;
            <a class="tl-table-alert-info-a2" @click="doClearSelected">全部清空</a>
          </template>
        </el-alert>
      </div>
      <!--表格渲染-->
      <el-table class="tl-table"  ref="mainTable" :height="tableHeight" resizable-key="tableHeight" :resizable-refs="['search', 'toolbar', 'selector', 'pager']" v-loading="loading" :data="datas" @selection-change="doSelectChange" @sort-change="doSortChange" row-key="id"
        border fit  :row-class-name="doChangeRowClassName">
        <el-table-column type="selection" width="55px" > </el-table-column>
        <el-table-column type="index" label="序号" width="55px" align="center" > </el-table-column>
        <el-table-column prop="name"  label="会议室名称" min-width="150px"   sortable="custom" sort-by="name"   ></el-table-column>
        <el-table-column prop="displocation"  label="位置" min-width="200px"   sortable="custom" sort-by="location"  ></el-table-column>
        <el-table-column prop="username" label="负责人" min-width="120px" sortable="custom" sort-by="username" ></el-table-column>
        <el-table-column prop="telephone" label="联系电话" min-width="120px" sortable="custom" sort-by="telephone"   ></el-table-column>
        <el-table-column prop="capacity" label="容量(人)" width="120px" sortable="custom" sort-by="capacity" align="center"  ></el-table-column>
        <el-table-column prop="square" label="面积(平米)" width="120px" sortable="custom" sort-by="square"  align="center"  ></el-table-column>
        <el-table-column  label="操作" width="220px" align="center" fixed="right">
          <template slot-scope="scope">
            <el-button  type="text"   icon="el-icon-edit"    @click="openEditDialog('editForm', scope.row.id)">编辑</el-button>
            <el-button  type="text"   icon="el-icon-delete"  @click="doDelete(scope.row.id)">删除</el-button>
            <el-button  type="text"   icon="el-icon-view" @click="openViewDialog('editForm', scope.row.id)">查看</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 列表分页 -->
      <el-row class="pagebar" ref="pager">
        <el-pagination @size-change="doChangeSize" @current-change="doChangeIndex" :current-page="pageInfo.currentPage" :page-sizes="pageInfo.pageSizes" :total="pageInfo.totalCount" layout="total, sizes, prev, pager, next, jumper" background class="tl-table-pagination"> </el-pagination>
      </el-row>
    </div>
    <tl-edit ref="editForm" @refresh="doRefresh"></tl-edit>
  </div>
</template>

<script>
// import checkPermission from '@/utils/permission' // 权限判断函数
/** mixins */
import { mixin_list } from "@tapui/mixins/mixin_list"
/** 子组件 */
import tlEdit from "./edit"
export default {
  name: "boardroomItem",
  components: { tlEdit },
  mixins: [mixin_list],
  data() {
    return {
      description: "这是会议室档案管理页面",
      url: {
        list: "/toa/boardroomItem/list",
        delete: "/toa/boardroomItem/delete",
        deleteBatch: "/toa/boardroomItem/deleteBatch",
        exportExcel: "/toa/boardroomItem/exportExcel" // 导出excel
      }
    }
  },
  methods: {
  }
}
</script>

<style scoped>

</style>
